package com.liu.nb.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.liu.nb.entity.CircuitryPole;
import com.liu.nb.service.ICircuitryPoleService;
import com.liu.nb.util.Result;
import org.springframework.web.bind.annotation.*;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;

/**
 * <p>
 * 塔杆和线路的中间表 前端控制器
 * </p>
 *
 * @author zk
 * @since 2021-09-07
 */
@RestController
@RequestMapping("/nb/circuitry-pole")
public class CircuitryPoleController extends BaseController{

    /**
     * 根据巡检线路选择查询该线路所有塔杆
     * @param cid
     * @return
     */
    @PostMapping("/getCircuitryId/{cid}")
    public Result getCircuitryId(@PathVariable String cid){
        List<CircuitryPole> circuitryIdList = circuitryPoleService.list(new QueryWrapper<CircuitryPole>()
                .eq("circuity_id", cid));
        return Result.success(circuitryIdList);
    }
}
